import request from '@/utils/request'

// 获取所有菜品
export function getAllDish(storeId) {
  return request({
    url: '/dish-service/dish/getAllDish',
    method: 'GET',
    params: {
      storeId: storeId
    }
  })
}

// 根据菜品ID获取菜品详情
export function getDishById(dishId) {
  return request({
    url: '/dish-service/dish/getDishById',
    method: 'GET',
    params: {
      dishId: dishId
    }
  })
}

// 根据菜品ID获取规格信息
export function getSpecByDishId(dishId) {
  return request({
    url: '/dish-service/dish/getSpecByDishId',
    method: 'GET',
    params: {
      dishId: dishId
    }
  })
}

// 检查库存
export function checkStock(orderDTO) {
  return request({
    url: '/dish-service/dish/checkStock',
    method: 'GET',
    data: orderDTO
  })
}

// 批量获取菜品信息（根据菜品ID列表）
export function getDishListByIds(dishIds) {
  return request({
    url: '/dish-service/dish/getDishListByIds',
    method: 'POST',
    data: dishIds  // 直接发送数组，不包装在对象中
  })
} 